﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using jDepot.Models;

namespace jDepot.ViewModels
{
    public class ProductSearchModel
    {
        public long ProductCategoryId { get; set; }
        public string ProductName { get; set; }
        public Product[] Results { get; set; }
        public SelectList Categories { get; set; }

        public ProductSearchModel()
        {
        }

        public ProductSearchModel(IQueryable<ProductCategory> categories)
        {
            Categories = new SelectList(categories, "ProductCategoryId", "Name");
        }

        public ProductSearchModel(Product[] results, IQueryable<ProductCategory> categories)
        {
            Results = results;
            Categories = new SelectList(categories, "ProductCategoryId", "Name");
        }
    }
}